package org.xzx.cloud.ad.client;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.xzx.cloud.ad.client.vo.AdPlan;
import org.xzx.cloud.ad.client.vo.AdPlanGetRequest;
import org.xzx.cloud.ad.vo.CommonResponse;

import java.util.List;

/**
 * 基于 Feign 实现微服务调用，并指定熔断回滚
 *
 * @author xzx
 */
@FeignClient(value = "ad-sponsor", fallback = SponsorClientHystrix.class)
public interface SponsorClient {

    /**
     * 调用微服务
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/ad-sponsor/get/adPlan", method = RequestMethod.POST)
    CommonResponse<List<AdPlan>> getAdPlansByFeign(@RequestBody AdPlanGetRequest request);
}
